package com.huawei.appgallery.wishlist.ui.activity;

import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import com.huawei.appgallery.foundation.service.common.protocol.request.AppListFragmentRequest;
import com.huawei.appgallery.foundation.ui.framework.cardframe.fragment.TaskFragment;
import com.huawei.appgallery.foundation.ui.framework.uikit.ContractFragment;
import com.huawei.appgallery.wishbase.ui.activity.WishBaseActivity;
import com.huawei.appgallery.wishlist.ui.fragment.WishAddFragment;
import com.huawei.appgallery.wishlist.ui.fragment.WishAddFragmentProtocol;
import com.huawei.appgallery.wishlist.ui.fragment.WishAddFragmentProtocol.Request;
import java.util.List;
import o.chb;
import o.cjk;
import o.cjm;
import o.cjo;
import o.dce.e;
import o.dce.i;
import o.dce.j;

public class WishCreateActivity extends WishBaseActivity<WishAddActivityProtocol> {
    private String ˊॱ = "";
    private String ˏॱ = "";
    private WishAddActivityProtocol ॱˊ;

    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(i.ˋ);
        ॱ(getString(j.ˉ), e.ͺॱ);
        this.ॱˊ = (WishAddActivityProtocol) ʾ();
        if (this.ॱˊ != null && this.ॱˊ.ˏ() != null) {
            this.ˏॱ = this.ॱˊ.ˏ().ˋ();
            this.ˊॱ = this.ॱˊ.ˏ().ˊ();
            ᐝ();
        }
    }

    public void onRequestPermissionsResult(int i, @NonNull String[] strArr, @NonNull int[] iArr) {
        super.onRequestPermissionsResult(i, strArr, iArr);
        if (i == 16 && iArr != null && iArr.length != 0 && iArr[0] == 0) {
            List<Fragment> ˏ = ˏॱ().ˏ();
            if (ˏ != null) {
                for (Fragment fragment : ˏ) {
                    if (fragment != null && WishAddFragment.class.equals(fragment.getClass())) {
                        fragment.ॱ(i, strArr, iArr);
                    }
                }
            }
        }
    }

    private void ᐝ() {
        cjo wishAddFragmentProtocol = new WishAddFragmentProtocol();
        AppListFragmentRequest request = new Request();
        request.ॱˊ(this.ˏॱ);
        request.ˋॱ(this.ˊॱ);
        request.ˏ(chb.SECONDARY_LIST_TAB);
        wishAddFragmentProtocol.ˏ(request);
        ContractFragment contractFragment = (ContractFragment) cjk.ˎ().ˊ(new cjm(this.ॱˊ.ॱ(), wishAddFragmentProtocol));
        if (contractFragment instanceof TaskFragment) {
            ((TaskFragment) contractFragment).ˋ(ˏॱ(), e.ᐝˋ, "WishAddFragmentTag");
        }
    }
}
